package com.yzyz.utils.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import com.yzyz.bean.scenic.DescriptionBean;

public class DescriptionRowMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int arg1) throws SQLException {
		DescriptionBean d = new DescriptionBean();
		d.setAvailable(true);
		d.setContents(rs.getString("contents"));
		d.setDate(new Date(rs.getTimestamp("date").getTime()));
		d.setId(rs.getInt("id"));
		d.setName(rs.getString("name"));
		d.setOwnerId(rs.getInt("ownerId"));
		return d;
	}

}
